using System;
using System.Collections.Generic;
using System.Text;
using Maticsoft.DBUtility;
using System.Data;

namespace ExtendBLL
{
    public class ProPlan:LabMS.BLL.ProfessionalPlan
    {
        public List<ExtendModule.ProPlan> GetModelList2(string strWhere) 
        {
            StringBuilder strSql = new StringBuilder();
            string strSql1 = "select * from ProfessionalPlan as ProPlan ,Professional as Pro where ProPlan.Pro_Professional=Pro.ID ";
            strSql.Append(strSql1);
            if (!string.IsNullOrEmpty(strWhere)) 
            {
                strSql.Append(" and ");
                strSql.Append(strWhere);
            }
            DataSet ds = DbHelperSQL.Query(strSql.ToString());
            List<ExtendModule.ProPlan> ls = new List<ExtendModule.ProPlan>();
            int rowCount = ds.Tables[0].Rows.Count;
            if (rowCount != 0)
            {
                ExtendModule.ProPlan model;
                for (int n = 0; n < rowCount; n++)
                {
                    model = new ExtendModule.ProPlan();
                    model = new ExtendModule.ProPlan();
                    if (ds.Tables[0].Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(ds.Tables[0].Rows[n]["ID"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["Pro_Year"].ToString() != "")
                    {
                        model.Pro_Year = int.Parse(ds.Tables[0].Rows[n]["Pro_Year"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["Pro_SubmitTime"].ToString() != "")
                    {
                        model.Pro_SubmitTime = DateTime.Parse(ds.Tables[0].Rows[n]["Pro_SubmitTime"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["Pro_Professional"].ToString() != "")
                    {
                        model.Pro_Professional = int.Parse(ds.Tables[0].Rows[n]["Pro_Professional"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["Pro_Curriculum"].ToString() != "")
                    {
                        model.Pro_Curriculum = int.Parse(ds.Tables[0].Rows[n]["Pro_Curriculum"].ToString());
                    }
                    model.Pro_Content = ds.Tables[0].Rows[n]["Pro_Content"].ToString();

                    model.ProfessionalName = ds.Tables[0].Rows[n]["Pro_Name"].ToString();

                    model.Pro_EnglishName = ds.Tables[0].Rows[n]["Pro_EnglishName"].ToString();

                    model.Pro_Education = ds.Tables[0].Rows[n]["Pro_Education"].ToString();
                    ls.Add(model);

                }
            }
            return ls;
        }

    }
}
